package TP2.pruebas;

import java.awt.Point;
import junit.framework.*;
import TP2.modelo.AvionCaza;

public class CazaTest extends TestCase {
	public void testMovimiento(){
		
		AvionCaza caza = new AvionCaza();
		Point pos1 = new Point();
		pos1.setLocation(25, 25);
		Point pos2 = new Point();
		caza.setPosicion(pos1);
		caza.vivir();
		pos1 = caza.getPosicion();
		pos2.move(25, 27);
		assertTrue(pos1.equals(pos2));
		
		for(int i = 1; i <= 15; i++){
			caza.vivir();
		}
		pos1 = caza.getPosicion();
		pos2.move(25, 57);
		assertTrue(pos1.equals(pos2));
		
		caza.vivir();
		pos1 = caza.getPosicion();
		pos2.move(25, 59);
		assertTrue(pos1.equals(pos2));
		
		for(int i = 1; i <= 37; i++){
			caza.vivir();
		}
		pos1 = caza.getPosicion();
		pos2.move(25, 133);
		assertTrue(pos1.equals(pos2));
		
		caza.vivir();
		pos1 = caza.getPosicion();
		pos2.move(25, 135);
		assertTrue(pos1.equals(pos2));
	}

}
